
import { routerRedux } from 'dva/router';
export default {
  namespace: 'layoutInfo',
  state: {
    apps: [{ id: 1, name: '与我相关' }, { id: 2, name: '单据管理' }, { id: 3, name: '系统设置' }],
    leftMenu: [{ id: 1, name: '@我的任务' }],
    rightMenu: [{ id: 1, name: '今天' }],
    userInfo: {
      userId: '',
      userName: '',
      joinedGroups: ['']
    }
  },
  reducers: {},
  effects: {},
  subscriptions: {
    setup({ dispatch }) {
      if (sessionStorage.getItem('accessToken') == null) {
        dispatch(routerRedux.push("/login"));
      }
    }
  },
};
